
package gestion_chambres;

import java.sql.DriverManager;
import java.sql.SQLException;
import javax.swing.JOptionPane;

/**
 *
 * @author anas
 */
public class Gestion_Chambres {

        java.sql.Connection conn = null;
    
    public static java.sql.Connection DB_Connection()
    {
    
        try {
            
            Class.forName("com.mysql.jdbc.Driver");
            java.sql.Connection conn =DriverManager.getConnection("jdbc:mysql://localhost:3306/Hotel", "root", "");
            //System.out.println("Connected");
            return conn;
            
        } catch (ClassNotFoundException | SQLException e) {
            JOptionPane.showMessageDialog(null,e.getMessage());
        }
    return null;
    }
    
    
    public static void main(String[] args) {
  
        
        
    }
    
}
